Ext.define('CS.page.Main', {
	requires: ['CS.page.BasePage'],

	mainPanel: undefined,

	constructor: function(config) {
		var me = this;

		config = Ext.create('CS.page.BasePage', config).getConfig();

		me.mainPanel = CS.create(config.panel);

		window.onresize = function() {
			me.mainPanel.doLayout();
		};
	},

	bind: function(eventItems) {
		var me = this, config = {};

		var config = CS.apply({}, {
			eventItems: eventItems,
			mainPanel: me.mainPanel
		});

		Ext.create('CS.controller.PageController', config).bind();
	},

	render: function() {
		this.mainPanel.render(Ext.getBody());
	},

	getData: function() {
		return this.mainPanel.getData();
	},

	setData: function(data) {
		this.mainPanel.setData(data);
	}

});
